package com.lucene.test.exception;

import java.io.Serial;

/**
 * @author zoumy9
 * @date 2024/05/24 08:41
 **/
public class LuceneException extends RuntimeException {
    @Serial
    private static final long serialVersionUID = 1024L;

    private Integer errCode;

    public LuceneException() {
        super();
    }

    public LuceneException(String message, Throwable cause) {
        super(message, cause);
    }


    public LuceneException(String message) {
        super(message);
    }

    public LuceneException(Integer errCode, String errMsg) {
        this(errMsg);
        this.errCode = errCode;
    }

    public LuceneException(Integer errorCode) {
        this(errorCode, "");
    }

    public LuceneException(Throwable throwable) {
        super(throwable);
        this.errCode = 5001;
    }

    public static LuceneException newException(Integer errorCode, String msg) {
        return new LuceneException(errorCode, msg);
    }
}
